<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/inc::header"/>
<body>
<table class="layui-table" id="grid" lay-filter="grid">
</table>
<script th:replace="/common/inc::incJs"></script>
<script>''
    var parentBdId = getQueryString("parentBdId");

    $(function () {
        var tableIns = createTable({
            url: '/backend/security/customer/pdCustomerList?parentBdId=' + parentBdId,
            cols: [[
                {field: 'nickName', title: '昵称', width: 160}, {field: 'userName', title: '姓名', width: 160}
                , {field: 'account', title: '账号', width: 160}, {
                    field: 'isVip',
                    title: '会员等级',
                    width: 150,
                    templet: '#vipTpl'
                }, {
                    field: 'createTime',
                    title: '注册时间',
                    width: 180
                }
            ]]
        });


        layui.table.on('tool(grid)', function (obj) { //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值
            var tr = obj.tr; //获得当前行 tr 的DOM对象
        });
    })
</script>
<script type="text/html" id="vipTpl">
    {{#  if(d.isVip ===0){ }}
    <span>非会员</span>
    {{#  } else if(d.isVip ===1){ }}
    <span style="color: green;">适用会员</span>
    {{#  } else if(d.isVip ===2){ }}
    <span style="color: blue;">任享会员</span>
    {{#  } else if(d.isVip ===3){ }}
    <span style="color: red;">畅享会员</span>
    {{#  } else if(d.isVip ===4){ }}
    <span style="color: yellowgreen;">季卡会员</span>
    {{#  } }}
</script>
</body>
</html>
